<!DOCTYPE html>
<html>
  <head>
    <title>
      Test performance of 100 AudioBufferSourceNodes.
    </title>
    <script src="../resources/runner.js"></script>
    <script src="resources/webaudio-perf-utils.js"></script>
  </head>
  <body>
    <script>
      function graphBuilder() {
        const context = new OfflineAudioContext(1, 48000, 48000);
        const buffer = createMonoRampBuffer(4800, 48000);
        const testNodes =
            createNodes(context, 'AudioBufferSourceNode', 100, {buffer});

        // All the test nodes fan-in to the destination node.
        testNodes.forEach(node => {
          node.connect(context.destination);
          node.start();
        });
        return context;
      }

      RunWebAudioPerfTest({
        description: 'Test performance of 100 AudioBufferSourceNodes',
        graphBuilder: graphBuilder,
        tracingOptions: {
          targetCategory: 'disabled-by-default-webaudio.audionode',
          targetEvents: ['AudioBufferSourceHandler::Process'],
        }
      });
    </script>
  </body>
</html>
